import vue from '@vitejs/plugin-vue'

import createAutoImport from './auto-import.js'
import createCompression from './compression.js'
import createSetupExtend from './setup-extend.js'
import createSetupMock from './setup-mock.js'
import createComponent from "./components.js";
import createVisualizer from "./visualizer.js";
export default function createVitePlugins (viteEnv, isBuild = false) {
  const vitePlugins = [vue()]
  vitePlugins.push(createAutoImport())
  vitePlugins.push(createSetupExtend())
  // vitePlugins.push(createComponent())
  // vitePlugins.push(createVisualizer())
  // if (process.env.NODE_ENV === 'production') {
  //   vitePlugins.push(createSetupMock())
  // }
  isBuild && vitePlugins.push(...createCompression(viteEnv))
  return vitePlugins
}
